﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>欢迎登录后台管理系统</title>
<link href="__PUBLIC__/Admin/Login/css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="__PUBLIC__/Admin/Login/js/jquery.js"></script>
<script src="__PUBLIC__/Admin/Login/js/cloud.js" type="text/javascript"></script>

<script language="javascript">
	$(function(){
    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
	$(window).resize(function(){  
    $('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
    })  
});  
</script> 

</head>

<body style="background-color:#1c77ac; background-image:url(__PUBLIC__/Admin/Login/images/light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">



    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  


<div class="logintop">    
    <span>欢迎登录后台管理界面平台</span>    
    <ul>
    </ul>    
    </div>
    
    <div class="loginbody">
    
    <span class="systemlogo"></span> 
       
    <div class="loginbox">
    
    <ul>
    <li><input  id="username"  type="text" class="loginuser" value="" /></li>
    <li><input name="" type="password" class="loginpwd" id="password" /></li>
    <li><input name="" type="button" class="loginbtn" id="login_btn" value="登录" /><label id="err_msg"></label></li>
    </ul>
    
    
    </div>
    
    </div>
    
    
    
    <div class="loginbm"></div>
	<script src="__ADMIN_JS__/jquery.min.js?v=2.1.4"></script>
	<script src="__ADMIN_JS__/bootstrap.min.js?v=3.3.6"></script>
	<script type="text/javascript">
		document.onkeydown=function(event){
			var e = event || window.event || arguments.callee.caller.arguments[0];
			if(e && e.keyCode==13){ // enter 键
				$('#login_btn').click();
			}
		};
		var lock = false;
		$(function () {
			$('#login_btn').click(function(){
				if(lock){
					return;
				}
				lock = true;
				$('#err_msg').hide();
				$('#login_btn').removeClass('btn-success').addClass('btn-danger').val('登陆中...');
				var username = $('#username').val();
				var password = $('#password').val();
				$.post("{:U('login/index')}",{'username':username, 'password':password},function(data){
					lock = false;
					$('#login_btn').val('登录').removeClass('btn-danger').addClass('btn-success');
					if(data.code!=true){
						$('#err_msg').show().html("<span style='color:red'>"+data.msg+"</span>");
						return;
					}else{
						window.location.href="{:U('Index/index')}";
					}
				});
			});
		});
	</script>
</body>
</html>
